/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package crawler;

/**
 *
 * @author marty
 */
public class Card {

    public static String ENTER = "\r\n";
    private final String id;
    private final int multiverId;
    private final String cardName;
    private final String manaCost;
    private final int convertedManaCost;
    private final String types;
    private final String cardText;
    private final String flavorText;
    private final String expansion;
    private final String rarity;
    private final String cardNumber;
    private final String artist;
    private final String imageUrl;

    /**
     *
     * @param multiverId
     * @param cardName
     * @param manaCost
     * @param convertedManaCost
     * @param types
     * @param cardText
     * @param flavorText
     * @param expansion
     * @param rarity
     * @param cardNumber
     * @param artist
     * @param imageUrl
     */
    public Card(int multiverId, String cardName, String manaCost, int convertedManaCost, String types, String cardText, String flavorText, String expansion, String rarity, String cardNumber, String artist) {
        this.id = multiverId + "#" + cardNumber;
        this.multiverId = multiverId;
        this.cardName = cardName;
        this.manaCost = manaCost;
        this.convertedManaCost = convertedManaCost;
        this.types = types;
        this.cardText = cardText;
        this.flavorText = flavorText;
        this.expansion = expansion;
        this.rarity = rarity;
        this.cardNumber = cardNumber;
        this.artist = artist;
        this.imageUrl = "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid="+multiverId+"&type=card";
    }

    public String getId() {
        return id;
    }

    public int getMultiverId() {
        return multiverId;
    }

    public String getCardName() {
        return cardName;
    }

    public String getManaCost() {
        return manaCost;
    }

    public int getConvertedManaCost() {
        return convertedManaCost;
    }

    public String getTypes() {
        return types;
    }

    public String getCardText() {
        return cardText;
    }

    public String getFlavorText() {
        return flavorText;
    }

    public String getExpansion() {
        return expansion;
    }

    public String getRarity() {
        return rarity;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public String getArtist() {
        return artist;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    @Override
    public String toString() {
        return id + cardName + "[" + expansion + "]" + manaCost + ";" 
                + convertedManaCost+";"+  types+";"+cardText+";"+ENTER
                +flavorText+";"+rarity+";"+artist+";"+imageUrl;
    }
}
